package com.web.service;

import com.web.dao.LogVersionMapper;
import com.web.entity.LogVersion;
import com.web.entity.Version;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author xukk
 * @date 2017/9/21
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class LogVersionService {
    @Autowired
    private LogVersionMapper logVersionMapper;

    public void addLogVersion(Version version) {
        LogVersion logVersion = new LogVersion();
        logVersion.setDownLoadUrl(version.getDownLoadUrl());
        logVersion.setDescription(version.getDescription());
        logVersion.setMaxVersion(version.getMaxVersion());
        logVersion.setMinVersion(version.getMinVersion());
        logVersion.setModifyTime(version.getModifyTime());
        logVersion.setCreateTime(version.getCreateTime());
        logVersion.setPlatform(version.getPlatform());
        logVersionMapper.insertSelective(logVersion);
    }
}
